import { Entity, Column, PrimaryColumn, PrimaryGeneratedColumn, ManyToMany, ManyToOne, JoinColumn, OneToOne, BaseEntity, OneToMany } from 'typeorm';
import {
  EnumProfitPostAnswer,
  profitEnum, profitTypeEnum
} from './profit.enum'

@Entity('profit')
export class Profit extends BaseEntity {
  @PrimaryGeneratedColumn()
  id: number;

  @PrimaryColumn({ name: 'answer_id' })
  answer_id: number;

  @Column({ name: 'author_wx_user' })
  author_wx_user: string;

  @PrimaryColumn({ name: 'use_wx_user' })
  use_wx_user: string;

  @Column({ name: 'use_duration' })
  use_duration: number;

  @Column({ name: 'sum_duration' })
  sum_duration: number;

  @Column({ name: 'status' })
  status: profitEnum;

  @Column({ name: 'create_time' })
  create_time: Date;

  @Column({ name: 'update_time' })
  update_time: Date;

  @Column({ name: 'trf_id' })
  trf_id: number;

  @Column({ name: 'wallflow_id' })
  wallflow_id: number;

  @Column({ name: 'unit_price' })
  unit_price: number;

  @Column({ name: 'service_charge' })
  service_charge: number;

  @Column({ name: 'type' })
  type: profitTypeEnum;

  @PrimaryColumn({ name: 'notes' })
  notes: string;

  @Column({ name: 'reject_reason' })
  reject_reason: string;

  @Column({ name: 'refund_type' })
  refund_type: number;

  @Column({ name: 'payment_on_behalf' })
  payment_on_behalf: number;

}
